#ifndef WIDGET_H
#define WIDGET_H

#include <head/g_pch.h>
#include "user.h"
#include "g_ver.h"
#include "m_fhs.h"

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

    void createTray();
    void fetchData();
    void updateToMemory();
    void awake();

private slots:
    void on_btn_login_clicked();

    void on_saved_stateChanged(int state);

private:
    Ui::Widget *ui;

    User user;

    QSystemTrayIcon *tray;
    QMenu *trayMenu;
    QSharedMemory *sharedMemory;

    QSqlDatabase profile;
    QMap<QString,QJsonObject> dataSource;
};
#endif // WIDGET_H
